package servlets;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

import bean.Bill;
import dao.*;

@WebServlet("/dealorder")
public class dealorder extends HttpServlet{
    private static final long serialVersionUID = 1L;
    public dealorder() { super(); }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
        doPost(request, response);
    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        String user_name = request.getParameter("user");
        BillDao billDao = new BillDao();
        billDao.delivergoods(user_name);
        response.sendRedirect("dealorder.jsp");
    }
}
